unit App.Action.TAppDefaultEditAction;

interface

uses SmallStruct.Action,
  App.Action.TAppCustomeAction;

type
  TAppDefaultEditAction = class(TAppCustomeAction)
  protected
    function DoPerform(ActionContext: ISSActionContext): Boolean; override;
  end;

implementation

uses SmallStruct.Configuration,
  SmallStruct.View,
  SmallStruct.Configuration.TSSViewConfiguration;

{ TAppDefaultEditAction }

function TAppDefaultEditAction.DoPerform(ActionContext: ISSActionContext): Boolean;
begin
  Result := False;

  ActionContext.GetResponseView.GetContext.GetParameter.AppendObject((ActionContext.GetRequestView.GetContext.GetConfiguration as ISSViewConfiguration).GetPrimaryModelName, GetRequestViewPrimaryDataModel.GetObjectInstance);
  (ActionContext.GetResponseView as ISSDataView).InitDataSource;

  (ActionContext.GetResponseView.GetContext.GetConfiguration.GetObjectInstance as TSSViewConfiguration).SetPrimaryModelName((ActionContext.GetRequestView.GetContext.GetConfiguration as ISSViewConfiguration).GetPrimaryModelName);

  GetRequestViewPrimaryDataModel.GetDataSet.GetDataSet.Edit;
  Result := True;
end;

end.
